<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>null NaN undefined的区别</title>
</head>

<body>
    <!-- 
        1. == 和 === 有什么区别？
            ==等同运算符：只比较值是否相等
            === 全等运算符：既比较值是否相等，同时又比较数据类型是否相同
        2.null NaN undefined的区别？
            类型都是不一样的
            null和undefined是等同关系


     -->

    <script>
        var v1 = true
        var v2 = 1

        alert(v1 == v2) // true
        alert(v1 === v2) // false

        var v3 = 1
        alert(v3 === v2)

        //null的类型属于原始类型, typeof运算符的结果是: object 
        console.log(typeof null) //"object" 
        console.log(typeof NaN) // "number" 
        console.log(typeof undefined) // "undefined" 

        console.log(null == NaN) //false 
        console.log(null == undefined) //true 
        console.log(undefined == NaN) //false  

        console.log(null === NaN) //false 
        console.log(null === undefined) //false 
        console.log(undefined === NaN) //false
    </script>
</body>

</html>